package com.github.boluo1230.wechat.entity.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class WxCustomVideo implements WxCustomMsg, Serializable {
    @JsonProperty(value = "touser")
    private String toUser;

    @JsonProperty(value = "msgtype")
    private String msgType = "video";

    @JsonProperty(value = "video")
    private Video video;

    public WxCustomVideo(String openId, String mediaId, String thumbMediaId,
                         String title, String description) {
        this.setToUser(openId);
        this.video = new Video();
        this.video.setTitle(title);
        this.video.setDescription(description);
        this.video.setMediaId(mediaId);
        this.video.setThumbMediaId(thumbMediaId);
    }

    @Getter
    @Setter
    public class Video {
        @JsonProperty(value = "media_id")
        private String mediaId;

        @JsonProperty(value = "thumb_media_id")
        private String thumbMediaId;

        @JsonProperty(value = "title")
        private String title;

        @JsonProperty(value = "description")
        private String description;
    }

}
